﻿using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;
using System;

namespace HRMService
{
    // NOTE: If you change the interface name "IDetail" here, you must also update the reference to "IDetail" in App.config.
    [ServiceContract(Namespace = "http://HRMService")]
    public interface IDetail
    {
        [OperationContract]
        DataSet Detail_GetAll();

        [OperationContract]
        int Detail_Using(int DetailID);

        [OperationContract]
        DataSet Detail_GetBySIBookNo(string _SIBookNo, string _BranchCode, DateTime _Dateval);

        [OperationContract]
        DetailInfo Detail_GetInfo(int DetailID);

        [OperationContract]
        DetailInfo Detail_CheckValid(string _InsBookNo, string InsType, string _BranchCode, DateTime _DateVal);

        [OperationContract]
        DataSet Detail_GetList(out int ItemCount, int currentPage, int pageSize, int _DocumentID);

        [OperationContract]
        int Detail_Insert(DetailInfo eInfo);

        [OperationContract]
        bool Detail_Update(DetailInfo eInfo);

        [OperationContract]
        bool Detail_Delete(int DetailID, int _DocumentID);

        [OperationContract]
        bool Detail_Exist(int _ID, string _SIBookNo, DateTime _FromDate, DateTime _ToDate, string _InsTypeCode, Decimal OldAmount, Decimal OldBasicFactor, Decimal OldPositionFactor, Decimal OldOverFactor, Decimal OldJobFactor, Decimal NewAmount, Decimal NewBasicFactor, Decimal NewPositionFactor, Decimal NewOverFactor, Decimal NewJobFactor);

        [OperationContract]
        bool Detail_CheckExistSIBookNo(string _SIBookNo, string _BranchCode);

        [OperationContract]
        DataSet Detail_Mau03_TangMoi(int period, int month, int year, string BranchCode);

        [OperationContract]
        DataSet Detail_Mau03Giam(int period, int month, int year, string BranchCode);

        [OperationContract]
        DataSet Detail_Mau03DCLuong(int period, int month, int year, string BranchCode);

        [OperationContract]
        DataSet Detail_Mau03BoSungBHTN(int period, int month, int year, string BranchCode);

        [OperationContract]
        DataSet Detail_Mau03BoSungBHYT(int period, int month, int year, string BranchCode);

        [OperationContract]
        DataSet Detail_TongHopMau03(int period, int month, int year, string BranchCode);

        [OperationContract]
        DataSet Detail_Mau03CuoiKy(int period, int month, int year, string BranchCode);

        /* Cac service test form 03 theo HS,ML */
        [OperationContract]
        DataSet Detail_Mau03_TangMoi_TEST(int period, int month, int year, string BranchCode,string TypeCode);
        [OperationContract]
        DataSet Detail_Mau03Giam_TEST(int period, int month, int year, string BranchCode, string TypeCode);
        [OperationContract]
        DataSet Detail_Mau03DCLuong_TEST(int period, int month, int year, string BranchCode, string TypeCode);
        [OperationContract]
        DataSet Detail_Mau03BoSungBHTN_TEST(int period, int month, int year, string BranchCode, string TypeCode);
        [OperationContract]
        DataSet Detail_Mau03BoSungBHYT_TEST(int period, int month, int year, string BranchCode, string TypeCode);
        [OperationContract]
        DataSet Detail_TongHopMau03_TEST(int period, int month, int year, string BranchCode, string TypeCode);
        [OperationContract]
        DataSet Detail_Mau03CuoiKy_TEST(int period, int month, int year, string BranchCode, string TypeCode);
        /*-- END ---------------*/

        [OperationContract]
        DataSet Detail_TongHopMau02(int period, int month, int year, string BranchCode, bool _IsAll);

        [OperationContract]
        DataSet Detail_GetForForm02(int period, int _month, int _year, string BranchCode, bool _IsAll);

        /*Test form 02*/
        [OperationContract]
        DataSet Detail_TongHopMau02_TEST(int period, int month, int year, string BranchCode, bool _IsAll,string _TypeCode);

        [OperationContract]
        DataSet Detail_GetForForm02_TEST(int period, int _month, int _year, string BranchCode, bool _IsAll,string _TypeCode);
        /*-------------*/

        [OperationContract]
        DataSet Detail_Mau03_Excel(int period, int month, int year, string BranchCode);

        //hiepdh: 29_02_12- Mẫu 02 toàn công ty
        [OperationContract]
        DataSet Detail_Mau02_Excel(int period, int month, int year, string BranchCode, bool _IsAll);

        [OperationContract]
        Boolean KiemTraGiaTriThangPhatSinh(string Detail_InsBookNo, DateTime Detail_ToDate);
        
        [OperationContract]
        string GetLastestHSML(string Detail_InsBookNo, out DateTime ToDate);
        
    }

    [DataContract(Namespace = "http://HRMService")]
    public class DetailInfo
    {
        int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        int _DocumentID;
        [DataMember]
        public int DocumentID
        {
            get { return _DocumentID; }
            set { _DocumentID = value; }
        }
        string _EmployeeCode;
        [DataMember]
        public string EmployeeCode
        {
            get { return _EmployeeCode; }
            set { _EmployeeCode = value; }
        }
        string _InsBookNo;
        [DataMember]
        public string InsBookNo
        {
            get { return _InsBookNo; }
            set { _InsBookNo = value; }
        }
        DateTime _FromDate;
        [DataMember]
        public DateTime FromDate
        {
            get { return _FromDate; }
            set { _FromDate = value; }
        }
        DateTime _ToDate;
        [DataMember]
        public DateTime ToDate
        {
            get { return _ToDate; }
            set { _ToDate = value; }
        }
        string _InsTypeCode;
        [DataMember]
        public string InsTypeCode
        {
            get { return _InsTypeCode; }
            set { _InsTypeCode = value; }
        }

        decimal _SocialRate;
        [DataMember]
        public decimal SocialRate
        {
            get { return _SocialRate; }
            set { _SocialRate = value; }
        }
        decimal _MedicalRate;
        [DataMember]
        public decimal MedicalRate
        {
            get { return _MedicalRate; }
            set { _MedicalRate = value; }
        }
        decimal _UnemployedRate;
        [DataMember]
        public decimal UnemployedRate
        {
            get { return _UnemployedRate; }
            set { _UnemployedRate = value; }
        }
        decimal _NewBasicFactor;
        [DataMember]
        public decimal NewBasicFactor
        {
            get { return _NewBasicFactor; }
            set { _NewBasicFactor = value; }
        }
        decimal _NewPositionFactor;
        [DataMember]
        public decimal NewPositionFactor
        {
            get { return _NewPositionFactor; }
            set { _NewPositionFactor = value; }
        }
        decimal _NewOverFactor;
        [DataMember]
        public decimal NewOverFactor
        {
            get { return _NewOverFactor; }
            set { _NewOverFactor = value; }
        }
        decimal _NewJobFactor;
        [DataMember]
        public decimal NewJobFactor
        {
            get { return _NewJobFactor; }
            set { _NewJobFactor = value; }
        }
        decimal _NewAreaFactor;
        [DataMember]
        public decimal NewAreaFactor
        {
            get { return _NewAreaFactor; }
            set { _NewAreaFactor = value; }
        }
        decimal _OldBasicFactor;
        [DataMember]
        public decimal OldBasicFactor
        {
            get { return _OldBasicFactor; }
            set { _OldBasicFactor = value; }
        }
        decimal _OldPositionFactor;
        [DataMember]
        public decimal OldPositionFactor
        {
            get { return _OldPositionFactor; }
            set { _OldPositionFactor = value; }
        }
        decimal _OldOverFactor;
        [DataMember]
        public decimal OldOverFactor
        {
            get { return _OldOverFactor; }
            set { _OldOverFactor = value; }
        }
        decimal _OldJobFactor;
        [DataMember]
        public decimal OldJobFactor
        {
            get { return _OldJobFactor; }
            set { _OldJobFactor = value; }
        }
        decimal _OldAreaFactor;
        [DataMember]
        public decimal OldAreaFactor
        {
            get { return _OldAreaFactor; }
            set { _OldAreaFactor = value; }
        }
        decimal _NewAmount;
        [DataMember]
        public decimal NewAmount
        {
            get { return _NewAmount; }
            set { _NewAmount = value; }
        }
        decimal _OldAmount;
        [DataMember]
        public decimal OldAmount
        {
            get { return _OldAmount; }
            set { _OldAmount = value; }
        }
        string _RegionCode;
        [DataMember]
        public string RegionCode
        {
            get { return _RegionCode; }
            set { _RegionCode = value; }
        }
        string _HospitalCode;
        [DataMember]
        public string HospitalCode
        {
            get { return _HospitalCode; }
            set { _HospitalCode = value; }
        }
        string _Type;
        [DataMember]
        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }
        bool _TakeCard;
        [DataMember]
        public bool TakeCard
        {
            get { return _TakeCard; }
            set { _TakeCard = value; }
        }
        int _Status;
        [DataMember]
        public int Status
        {
            get { return _Status; }
            set { _Status = value; }
        }
        int _TotalMonth;
        [DataMember]
        public int TotalMonth
        {
            get { return _TotalMonth; }
            set { _TotalMonth = value; }
        }
        decimal _MedicalIncrease;
        [DataMember]
        public decimal MedicalIncrease
        {
            get { return _MedicalIncrease; }
            set { _MedicalIncrease = value; }
        }
        decimal _MedicalDecrease;
        [DataMember]
        public decimal MedicalDecrease
        {
            get { return _MedicalDecrease; }
            set { _MedicalDecrease = value; }
        }
        decimal _MedicalIncreaseAmount;
        [DataMember]
        public decimal MedicalIncreaseAmount
        {
            get { return _MedicalIncreaseAmount; }
            set { _MedicalIncreaseAmount = value; }
        }
        decimal _MedicalDecreaseAmount;
        [DataMember]
        public decimal MedicalDecreaseAmount
        {
            get { return _MedicalDecreaseAmount; }
            set { _MedicalDecreaseAmount = value; }
        }

        decimal _UnemployedIncrease;
        [DataMember]
        public decimal UnemployedIncrease
        {
            get { return _UnemployedIncrease; }
            set { _UnemployedIncrease = value; }
        }
        decimal _UnemployedDecrease;
        [DataMember]
        public decimal UnemployedDecrease
        {
            get { return _UnemployedDecrease; }
            set { _UnemployedDecrease = value; }
        }
        decimal _UnemployedIncreaseAmount;
        [DataMember]
        public decimal UnemployedIncreaseAmount
        {
            get { return _UnemployedIncreaseAmount; }
            set { _UnemployedIncreaseAmount = value; }
        }
        decimal _UnemployedDecreaseAmount;
        [DataMember]
        public decimal UnemployedDecreaseAmount
        {
            get { return _UnemployedDecreaseAmount; }
            set { _UnemployedDecreaseAmount = value; }
        }

        decimal _SocialIncrease;
        [DataMember]
        public decimal SocialIncrease
        {
            get { return _SocialIncrease; }
            set { _SocialIncrease = value; }
        }
        decimal _SocialDecrease;
        [DataMember]
        public decimal SocialDecrease
        {
            get { return _SocialDecrease; }
            set { _SocialDecrease = value; }
        }
        decimal _SocialIncreaseAmount;
        [DataMember]
        public decimal SocialIncreaseAmount
        {
            get { return _SocialIncreaseAmount; }
            set { _SocialIncreaseAmount = value; }
        }
        decimal _SocialDecreaseAmount;
        [DataMember]
        public decimal SocialDecreaseAmount
        {
            get { return _SocialDecreaseAmount; }
            set { _SocialDecreaseAmount = value; }
        }
        decimal _BasicSalary;
        [DataMember]
        public decimal BasicSalary
        {
            get { return _BasicSalary; }
            set { _BasicSalary = value; }
        }

        string _Description;
        [DataMember]
        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }
    }
}
